package com.youlai.boot.factory.model.form;

import java.io.Serial;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.math.BigDecimal;
import jakarta.validation.constraints.*;

/**
 * 工序模板明细表单对象
 *
 * @author youlaitech
 * @since 2025-10-01 05:19
 */
@Getter
@Setter
@Schema(description = "工序模板明细表单对象")
public class ProcessTemplateDetailForm implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "明细ID，主键")
    private Long id;

    @Schema(description = "模板ID")
    @NotNull(message = "模板ID不能为空")
    private Long templateId;

    @Schema(description = "工序ID")
    private Long processId;

    @Schema(description = "工序顺序")
    private Integer sequenceOrder;

    @Schema(description = "标准工时（分钟，可覆盖工序表的标准工时）")
    private BigDecimal standardTime;

    @Schema(description = "工序单价（元，可覆盖工序表的单价）")
    private BigDecimal unitPrice;

    @Schema(description = "所需技能（可覆盖工序表的技能要求）")
    @Size(max=100, message="所需技能（可覆盖工序表的技能要求）长度不能超过100个字符")
    private String requiredSkill;

    @Schema(description = "设备要求（可覆盖工序表的设备要求）")
    @Size(max=200, message="设备要求（可覆盖工序表的设备要求）长度不能超过200个字符")
    private String equipmentRequirements;

    @Schema(description = "质量注意事项")
    @Size(max=65535, message="质量注意事项长度不能超过65535个字符")
    private String qualityNotes;

    @Schema(description = "是否关键工序：0-否，1-是")
    private Integer isCritical;

    @Schema(description = "前道工序ID（用于建立依赖关系）")
    private Long previousProcessId;

    @Schema(description = "创建人")
    @Size(max=50, message="创建人长度不能超过50个字符")
    private String createBy;

    @Schema(description = "创建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "更新人")
    @Size(max=50, message="更新人长度不能超过50个字符")
    private String updateBy;

    @Schema(description = "更新时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @Schema(description = "工序名称")
    private String processName;
}
